<?php
class CategoryAction extends CommonAction{
	function index(){
		$Category=D('Category');
		$this->data=$Category->getchildren(1);
		var_dump($this->data);
	}
	function gettree(){
		//$id=0;
		$Category=D('Category');
		$data=$Category->select();
		$Tree=new Tree($data);
		$str="<span class='file'>\$category_name</span>";
		$str2="<span class='folder'>\$category_name</span>" ;
		$this->data=$Tree->get_treeview(0,'tree',$str,$str2);
		$str3="<option value=\$id \$selected>\$spacer\$category_name</option>";
		$this->select=$Tree->get_tree(0, $str3,4);
		var_dump($this->data);
		$this->display();
	}
	
	//
	function t(){
		// Array to be sorted
		$Category=D('Category');
		//$this->data=$Category->where(array('id'=>$id))->select();
		$data=$Category->order('pid asc')->select();
		//var_dump($this->data);
		//$data=parse($data);
		var_dump($data);
	}
	// Comparison function

}
?>